// import Vue from 'vue'
// import createStore from 'app/src/store/index'
// import axios from 'axios'

// const store = typeof createStore === 'function'
//   ? createStore({ Vue })
//   : createStore

/**
 * 埋点功能
 * 统计用户点击数量
 * **/

export default function stat (el, binding, vnode) {
  // let { id, name } = binding.value
  // if (id.length === 0) {
  // return
  // }
  // let userInfo = store.getters.userInfo
  el.addEventListener('click', (e) => {
    e.stopPropagation()
    // e.preventDefault()
    // let params = {
    //   data: {
    //     model_uid: '0002',
    //     user_id: userInfo.user_id + '',
    //     user_name: userInfo.user_nickname,
    //     phone: userInfo.user_name,
    //     factory_id: userInfo.tenant_id + '',
    //     factory_name: userInfo.company_name,
    //     button_id: id,
    //     button_name: name
    //   },
    //   func: 'client_click_event'
    // }

    // axios.post(process.env.STAT_URL + 'fill/fill/api', params)
  })
}
